package org.sgx.gapi.client.apis.youtube;

import org.sgx.jsutil.client.JsObject;

import com.google.gwt.core.client.JavaScriptObject;

/**
 * The snippet object contains basic details about a search result, such as its title or description. For example, if the search result is a video, then the title will be the
 * video's title and the description will be the video's description.
 * 
 * @see https://developers.google.com/youtube/v3/docs/search#resource
 * @author sg
 * 
 */
public class SearchSnippet extends JavaScriptObject {
	protected SearchSnippet() {
	}

	public static final native SearchSnippet create()/*-{
		return {};
	}-*/;

	/**
	 * The creation date and time of the resource that the search result identifies. The value is specified in ISO 8601 (YYYY-MM-DDThh:mm:ss.sZ) format.
	 * 
	 * @return
	 */
	public native final String publishedAt() /*-{
		return this["publishedAt"];
	}-*/;

	/**
	 * The creation date and time of the resource that the search result identifies. The value is specified in ISO 8601 (YYYY-MM-DDThh:mm:ss.sZ) format.
	 * 
	 * @param val
	 * @return this - for setter chaining
	 */
	public native final SearchSnippet publishedAt(String val) /*-{
		this["publishedAt"] = val;
		return this;
	}-*/;

	/**
	 * The value that YouTube uses to uniquely identify the channel that published the resource that the search result identifies.
	 * 
	 * @return
	 */
	public native final String channelId() /*-{
		return this["channelId"];
	}-*/;

	/**
	 * The value that YouTube uses to uniquely identify the channel that published the resource that the search result identifies.
	 * 
	 * @param val
	 * @return this - for setter chaining
	 */
	public native final SearchSnippet channelId(String val) /*-{
		this["channelId"] = val;
		return this;
	}-*/;

	/**
	 * The title to display for the search result.
	 * 
	 * @return
	 */
	public native final String title() /*-{
		return this["title"];
	}-*/;

	/**
	 * The title to display for the search result.
	 * 
	 * @param val
	 * @return this - for setter chaining
	 */
	public native final SearchSnippet title(String val) /*-{
		this["title"] = val;
		return this;
	}-*/;

	/**
	 * A description of the search result.
	 * 
	 * @return
	 */
	public native final String description() /*-{
		return this["description"];
	}-*/;

	/**
	 * A description of the search result.
	 * 
	 * @param val
	 * @return this - for setter chaining
	 */
	public native final SearchSnippet description(String val) /*-{
		this["description"] = val;
		return this;
	}-*/;

	/**
	 * A map of thumbnail images associated with the search result. For each object in the map, the key is the name of the thumbnail image, and the value is an object that contains
	 * other information about the thumbnail. TODO: do this better.
	 * 
	 * @return
	 */
	public native final JsObject thumbnails() /*-{
		return this["thumbnails"];
	}-*/;
	
	public native final SearchSnippetThumbnail thumbnail(String name) /*-{
		return this["thumbnails"][name];
	}-*/;
	

//	/**
//	 * A map of thumbnail images associated with the search result. For each object in the map, the key is the name of the thumbnail image, and the value is an object that contains
//	 * other information about the thumbnail. TODO: do this better.
//	 * 
//	 * @param val
//	 * @return this - for setter chaining
//	 */
//	public native final SearchSnippetThumbnails thumbnails(JsObject val) /*-{
//		this["thumbnails"] = val;
//		return this;
//	}-*/;

}
